<template>
  <div class="container">
    <el-card>
      <div class="box">
        <avue-crud
          :data="data"
          :option="option1"
          :page.sync="page"
          @size-change="sizeChange"
          @current-change="currentChange"
        ></avue-crud>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      page: {
        currentPage: 1,
        total: 0,
        pageSize: 10,
      },
      data: [
        {
          id: "3456654321",
          name: "张三",
          conent: "查看xxx",
          results: "成功",
          time: "2020-08-18",
        },
        {
          id: "34567876543",
          name: "李四",
          conent: "查看qwe",
          results: "成功",
          time: "2020-08-18",
        },
        {
          id: "324565432",
          name: "王五",
          conent: "查看sxc",
          results: "成功",
          time: "2020-08-18",
        },
        {
          id: "123454321",
          name: "马六",
          conent: "查看sca",
          results: "成功",
          time: "2020-08-18",
        },
        {
          id: "75421365",
          name: "赵一",
          conent: "查看vf",
          results: "成功",
          time: "2020-08-18",
        },
      ],
      option1: {
        menu: false,
        page: false,
        addBtn: false,
        align: "center",
        menuAlign: "center",
        column: [
          {
            label: "设备id",
            prop: "id",
            width: "110 ",
          },
          {
            label: "操作员",
            prop: "name",
          },
          {
            label: "操作内容",
            prop: "conent",
          },
          {
            label: "操作结果",
            prop: "results",
          },
          {
            label: "操作时间",
            prop: "time",
          },
        ],
      },
    };
  },
  created() {
    this.page.total = 40;
  },
  methods: {
    sizeChange(val) {
      this.page.currentPage = 1;
      this.page.pageSize = val;
      this.getList();
      this.$message.success("行数" + val);
    },
    currentChange(val) {
      this.page.currentPage = val;
      this.getList();
      this.$message.success("页码" + val);
    },
  },
};
</script>

<style scoped lang='scss'>
.box {
  /deep/.avue-crud__menu {
    visibility: hidden;
    // display: none;
  }
}
</style>